package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TeacherCertificate generated by hbm2java
 */
@Entity
@Table(name = "teacher_certificate")
public class TeacherCertificate implements java.io.Serializable {

	private Long id;
	private Teacher teacher;
	private String certificateType;
	private String certificateId;
	private String major;
	private Date validDate;
	private Date issueDate;
	private Set<CertificateRank> certificateRanks = new HashSet<CertificateRank>(
			0);

	public TeacherCertificate() {
	}

	public TeacherCertificate(Teacher teacher, String certificateType,
			String certificateId, String major, Date validDate, Date issueDate,
			Set<CertificateRank> certificateRanks) {
		this.teacher = teacher;
		this.certificateType = certificateType;
		this.certificateId = certificateId;
		this.major = major;
		this.validDate = validDate;
		this.issueDate = issueDate;
		this.certificateRanks = certificateRanks;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TEACHER_ID")
	public Teacher getTeacher() {
		return this.teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	@Column(name = "CERTIFICATE_TYPE", length = 20)
	public String getCertificateType() {
		return this.certificateType;
	}

	public void setCertificateType(String certificateType) {
		this.certificateType = certificateType;
	}

	@Column(name = "CERTIFICATE_ID", length = 50)
	public String getCertificateId() {
		return this.certificateId;
	}

	public void setCertificateId(String certificateId) {
		this.certificateId = certificateId;
	}

	@Column(name = "MAJOR", length = 30)
	public String getMajor() {
		return this.major;
	}

	public void setMajor(String major) {
		this.major = major;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "VALID_DATE", length = 19)
	public Date getValidDate() {
		return this.validDate;
	}

	public void setValidDate(Date validDate) {
		this.validDate = validDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "ISSUE_DATE", length = 19)
	public Date getIssueDate() {
		return this.issueDate;
	}

	public void setIssueDate(Date issueDate) {
		this.issueDate = issueDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "teacherCertificate")
	public Set<CertificateRank> getCertificateRanks() {
		return this.certificateRanks;
	}

	public void setCertificateRanks(Set<CertificateRank> certificateRanks) {
		this.certificateRanks = certificateRanks;
	}

}
